package com.dyzx.hbb.modules.sys.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@Schema(description = "找回密码")
@Data
public class UserPasswordChangeVO {

  /*  @Schema(description = "ID")
    @NotNull(message = "ID不能为空")
    @JsonProperty("id")
    private Long id;*/

    @Schema(description = "旧密码")
    @NotBlank(message = "旧密码不能为空")
    @JsonProperty("old_password")
    private String oldPassword;

    @Schema(description = "新密码")
    @NotBlank(message = "新密码不能为空")
    @JsonProperty("new_password")
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{8,16}$", message = "密码必须包含大小写字母和数字,长度在8-16位之间")
    private String newPassword;

}